<div class="blazorise-codeblock">
<div class="html"><pre>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Autocomplete</span> <span class="htmlAttributeName">TItem</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">MySelectModel</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName">TValue</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">string</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName">Data</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="sharpVariable"><span class="atSign">&#64;</span>myDdlData</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName">TextField</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue"><span class="atSign">&#64;</span>(( item ) =&gt; item.MyTextField)</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName">ValueField</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue"><span class="atSign">&#64;</span>(( item ) =&gt; item.MyTextField)</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName">SelectedValue</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="sharpVariable"><span class="atSign">&#64;</span>selectedSearchValue</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName">SelectedValueChanged</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="sharpVariable"><span class="atSign">&#64;</span>MySearchHandler</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName"><span class="atSign">&#64;</span>bind-SelectedText</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">selectedAutoCompleteText</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName">Placeholder</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">Search...</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName">Filter</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="enum">AutocompleteFilter</span><span class="enumValue">.StartsWith</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName">FreeTyping</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="keyword">true</span><span class="quot">&quot;</span>
              <span class="htmlAttributeName">CustomFilter</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue"><span class="atSign">&#64;</span>(( item, searchValue ) =&gt; item.MyTextField.IndexOf( searchValue, 0, StringComparison.CurrentCultureIgnoreCase ) &gt;= 0 )</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">NotFoundContent</span><span class="htmlTagDelimiter">&gt;</span> Sorry... <span class="atSign">&#64;</span>context was not found! :( <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">NotFoundContent</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Autocomplete</span><span class="htmlTagDelimiter">&gt;</span>

<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Field</span> <span class="htmlAttributeName">Horizontal</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="keyword">true</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">FieldBody</span> <span class="htmlAttributeName">ColumnSize</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="enum">ColumnSize</span><span class="enumValue">.Is12</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
        Selected search value: <span class="atSign">&#64;</span>selectedSearchValue
    <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">FieldBody</span><span class="htmlTagDelimiter">&gt;</span>
    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">FieldBody</span> <span class="htmlAttributeName">ColumnSize</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="enum">ColumnSize</span><span class="enumValue">.Is12</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
        Selected text value: <span class="atSign">&#64;</span>selectedAutoCompleteText
    <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">FieldBody</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Field</span><span class="htmlTagDelimiter">&gt;</span>
</pre></div>
<div class="csharp"><pre>
<span class="atSign">&#64;</span>code{
    <span class="keyword">public</span> <span class="keyword">class</span> MySelectModel
    {
        <span class="keyword">public</span> <span class="keyword">int</span> MyValueField { <span class="keyword">get</span>; <span class="keyword">set</span>; }
        <span class="keyword">public</span> <span class="keyword">string</span> MyTextField { <span class="keyword">get</span>; <span class="keyword">set</span>; }
    }

    <span class="keyword">static</span> <span class="keyword">string</span>[] Countries = { <span class="string">&quot;Albania&quot;</span>, <span class="string">&quot;Andorra&quot;</span>, <span class="string">&quot;Armenia&quot;</span>, <span class="string">&quot;Austria&quot;</span>, <span class="string">&quot;Azerbaijan&quot;</span>, <span class="string">&quot;Belarus&quot;</span>, <span class="string">&quot;Belgium&quot;</span>, <span class="string">&quot;Bosnia &amp; Herzegovina&quot;</span>, <span class="string">&quot;Bulgaria&quot;</span>, <span class="string">&quot;Croatia&quot;</span>, <span class="string">&quot;Cyprus&quot;</span>, <span class="string">&quot;Czech Republic&quot;</span>, <span class="string">&quot;Denmark&quot;</span>, <span class="string">&quot;Estonia&quot;</span>, <span class="string">&quot;Finland&quot;</span>, <span class="string">&quot;France&quot;</span>, <span class="string">&quot;Georgia&quot;</span>, <span class="string">&quot;Germany&quot;</span>, <span class="string">&quot;Greece&quot;</span>, <span class="string">&quot;Hungary&quot;</span>, <span class="string">&quot;Iceland&quot;</span>, <span class="string">&quot;Ireland&quot;</span>, <span class="string">&quot;Italy&quot;</span>, <span class="string">&quot;Kosovo&quot;</span>, <span class="string">&quot;Latvia&quot;</span>, <span class="string">&quot;Liechtenstein&quot;</span>, <span class="string">&quot;Lithuania&quot;</span>, <span class="string">&quot;Luxembourg&quot;</span>, <span class="string">&quot;Macedonia&quot;</span>, <span class="string">&quot;Malta&quot;</span>, <span class="string">&quot;Moldova&quot;</span>, <span class="string">&quot;Monaco&quot;</span>, <span class="string">&quot;Montenegro&quot;</span>, <span class="string">&quot;Netherlands&quot;</span>, <span class="string">&quot;Norway&quot;</span>, <span class="string">&quot;Poland&quot;</span>, <span class="string">&quot;Portugal&quot;</span>, <span class="string">&quot;Romania&quot;</span>, <span class="string">&quot;Russia&quot;</span>, <span class="string">&quot;San Marino&quot;</span>, <span class="string">&quot;Serbia&quot;</span>, <span class="string">&quot;Slovakia&quot;</span>, <span class="string">&quot;Slovenia&quot;</span>, <span class="string">&quot;Spain&quot;</span>, <span class="string">&quot;Sweden&quot;</span>, <span class="string">&quot;Switzerland&quot;</span>, <span class="string">&quot;Turkey&quot;</span>, <span class="string">&quot;Ukraine&quot;</span>, <span class="string">&quot;United Kingdom&quot;</span>, <span class="string">&quot;Vatican City&quot;</span> };
    IEnumerable&lt;MySelectModel&gt; myDdlData = Enumerable.Range( <span class="number">1</span>, Countries.Length ).Select( x =&gt; <span class="keyword">new</span> MySelectModel { MyTextField = Countries[x - <span class="number">1</span>], MyValueField = x } );

    <span class="keyword">string</span> selectedSearchValue { <span class="keyword">get</span>; <span class="keyword">set</span>; }
    <span class="keyword">string</span> selectedAutoCompleteText { <span class="keyword">get</span>; <span class="keyword">set</span>; }

    <span class="keyword">void</span> MySearchHandler( <span class="keyword">string</span> newValue )
    {
        selectedSearchValue = newValue;
    }
}
</pre></div>
</div>
